AddRows
Adds the new rows to the current table.
Syntax
expression.AddRows(nCount, isBefore);
expression
- A variable that represents a ApiTableRow class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
nCount | Required | Number | Count of rows to be added. | |
isBefore | Optional | boolean | false | Specifies if the rows will be added before or after the current row. |
Returns
ApiTable | null
Example
This example adds the new rows to the table.
let doc = Api.GetDocument();
let tableStyle = doc.CreateStyle("CustomTableStyle", "table");
tableStyle.SetBasedOn(doc.GetStyle("Bordered"));
let table = Api.CreateTable(3, 3);
table.SetStyle(tableStyle);
let row = table.GetRow(0);
row.GetCell(0).GetContent().GetElement(0).AddText("Second row");
table.SetWidth("percent", 100);
row.AddRows(1, true);
doc.Push(table);